<!DOCTYPE html>

<html>
<head>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">

<title>README - RDoc Documentation</title>

<link type="text/css" media="screen" href="./rdoc.css" rel="stylesheet">

<script type="text/javascript">
  var rdoc_rel_prefix = "./";
</script>

<script type="text/javascript" charset="utf-8" src="./js/jquery.js"></script>
<script type="text/javascript" charset="utf-8" src="./js/navigation.js"></script>
<script type="text/javascript" charset="utf-8" src="./js/search_index.js"></script>
<script type="text/javascript" charset="utf-8" src="./js/search.js"></script>
<script type="text/javascript" charset="utf-8" src="./js/searcher.js"></script>
<script type="text/javascript" charset="utf-8" src="./js/darkfish.js"></script>


<body class="file">
<nav id="metadata">
  <nav id="home-section" class="section">
  <h3 class="section-header">
    <a href="./index.html">Home</a>
    <a href="./table_of_contents.html#classes">Classes</a>
    <a href="./table_of_contents.html#methods">Methods</a>
  </h3>
</nav>


  <nav id="search-section" class="section project-section" class="initially-hidden">
  <form action="#" method="get" accept-charset="utf-8">
    <h3 class="section-header">
      <input type="text" name="search" placeholder="Search" id="search-field"
             title="Type to search, Up and Down to navigate, Enter to load">
    </h3>
  </form>

  <ul id="search-results" class="initially-hidden"></ul>
</nav>


  
<div id="table-of-contents">
  <nav class="section">
    <h3 class="section-header">Table of Contents</h3>
    <ul>
      <li><a href="#label-Usage">Usage</a>
      <li><a href="#label-Command+Line">Command Line</a>
      <li><a href="#label-As+A+Module">As A Module</a>
      <li><a href="#label-Documentation">Documentation</a>
      <li><a href="#label-Why+Have+You+Done+This+Thing%3F">Why Have You Done This Thing?</a>
      <li><a href="#label-Where+Does+It+Go+From+Here">Where Does It Go From Here</a>
    </ul>
  </nav>
</div>


  <div id="project-metadata">
    <nav id="fileindex-section" class="section project-section">
  <h3 class="section-header">Pages</h3>

  <ul>
  
    <li class="file"><a href="./LICENSE.html">LICENSE</a>
  
    <li class="file"><a href="./README_md.html">README</a>
  
    <li class="file"><a href="./doc/created_rid.html">created.rid</a>
  
    <li class="file"><a href="./features/physh_roller/parse_dice_roll_string_feature.html">parse_dice_roll_string.feature</a>
  
    <li class="file"><a href="./features/physh_roller/roll_dice_feature.html">roll_dice.feature</a>
  
    <li class="file"><a href="./features/physh_roller/roll_die_feature.html">roll_die.feature</a>
  
    <li class="file"><a href="./physh_roller_gemspec.html">physh_roller.gemspec</a>
  
  </ul>
</nav>

    <nav id="classindex-section" class="section project-section">
  <h3 class="section-header">Class and Module Index</h3>

  <ul class="link-list">
  
    <li><a href="./Object.html">Object</a>
  
    <li><a href="./Output.html">Output</a>
  
    <li><a href="./PhyshRoller.html">PhyshRoller</a>
  
    <li><a href="./PhyshRoller/DiceRoll.html">PhyshRoller::DiceRoll</a>
  
    <li><a href="./PhyshRoller/Die.html">PhyshRoller::Die</a>
  
    <li><a href="./PhyshRoller/FateRoll.html">PhyshRoller::FateRoll</a>
  
  </ul>
</nav>

  </div>
</nav>

<div id="documentation" class="description">
  
<p>A simple dice rolling application.</p>

<h1 id="label-Usage">Usage<span><a href="#label-Usage">&para;</a> <a href="#documentation">&uarr;</a></span></h1>

<h2 id="label-Command+Line">Command Line<span><a href="#label-Command+Line">&para;</a> <a href="#documentation">&uarr;</a></span></h2>

<p>If you&#39;ve installed the gem, you can simply run:</p>

<pre>dice &lt;the_dice_string_i_want_to_roll&gt;</pre>

<p>Example dice strings are 4d6, 20d100-20, 14D2+6. Basically, anything that
matches the regular expression /<a
href=“http://+-”>A(d+)?d(d+)(</a>d*)?z/i.</p>

<p>Command line help is available with</p>

<pre>dice --help</pre>

<p>Now supports FATE dice rolls with:</p>

<pre>dice -f</pre>

<h2 id="label-As+A+Module">As A Module<span><a href="#label-As+A+Module">&para;</a> <a href="#documentation">&uarr;</a></span></h2>

<p>You can require physh_roller in a Ruby application and then create
dicerolls.</p>

<p>For example:</p>

<pre class="ruby"><span class="ruby-identifier">dice_roll</span> = <span class="ruby-constant">PhyshRoller</span><span class="ruby-operator">::</span><span class="ruby-constant">DiceRoll</span>.<span class="ruby-identifier">new</span>(<span class="ruby-string">&#39;2d10+30&#39;</span>)
<span class="ruby-identifier">dice_roll</span>.<span class="ruby-identifier">roll_dice</span>
<span class="ruby-identifier">first_roll</span> = <span class="ruby-identifier">dice_roll</span>.<span class="ruby-identifier">results</span>
<span class="ruby-identifier">dice_roll</span>.<span class="ruby-identifier">roll_dice</span>
<span class="ruby-identifier">second_roll</span> = <span class="ruby-identifier">dice_roll</span>.<span class="ruby-identifier">results</span>
<span class="ruby-identifier">first_total</span> = <span class="ruby-identifier">first_roll</span>[:<span class="ruby-identifier">sum</span>]
<span class="ruby-identifier">second_total</span> = <span class="ruby-identifier">second_roll</span>[:<span class="ruby-identifier">sum</span>]
</pre>

<h1 id="label-Documentation">Documentation<span><a href="#label-Documentation">&para;</a> <a href="#documentation">&uarr;</a></span></h1>

<p>More documentation is available in RDoc format in the /doc folder.</p>

<h1 id="label-Why+Have+You+Done+This+Thing%3F">Why Have You Done This Thing?<span><a href="#label-Why+Have+You+Done+This+Thing%3F">&para;</a> <a href="#documentation">&uarr;</a></span></h1>

<p>I play RPGs a lot. A lot of the tools I build relate to these games and
most of them use dice rolls. I got fed up having to do stuff on the fly and
decided to do the thing properly.</p>

<p>This is also my first real excursion in to really using BDD/TDD. I might
have paid lip service to writing tests first, but the end goal was working
code. This time I&#39;m (hopefully) doing it right.</p>

<p>If you have the time, please take a look at the Cucumber and RSpec test
suite and let me know where it can be improved. That goes for the rest of
the code too. :)</p>

<h1 id="label-Where+Does+It+Go+From+Here">Where Does It Go From Here<span><a href="#label-Where+Does+It+Go+From+Here">&para;</a> <a href="#documentation">&uarr;</a></span></h1>

<p>I fully intend to add functionality for exploding dice (reroll on maximum,
or a threshold), successes on individual dice (as per Shadowrun or nWoD).</p>

<p>Again, if there are any other dice strangenesses you would like to see
implemented, please do let me know.</p>

</div>



<footer id="validator-badges">
  <p><a href="http://validator.w3.org/check/referer">[Validate]</a>
  <p>Generated by <a href="https://github.com/rdoc/rdoc">RDoc</a> 4.0.0.
  <p>Generated with the <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish Rdoc Generator</a> 3.
</footer>

